﻿using Company.Shell.Enums;
using Company.Shell.Models;
using LiveCharts;
using LiveCharts.Defaults;
using System.Collections.ObjectModel;
using System.Windows;

namespace Company.Shell.Interfaces
{
    /// <summary>
    /// 程序文件管理器
    /// </summary>
    public interface IProgramManager
    {
        /// <summary>
        /// 所有程序文件
        /// </summary>
        ObservableCollection<ProgramEntity> Programs { get; set; }
        /// <summary>
        /// 当前程序文件
        /// </summary>
        ProgramEntity Program { get; set; }
        /// <summary>
        /// 保存程序文件
        /// </summary>
        /// <param name="filename"></param>
        /// <returns></returns>
        Task Save(string filename = "");
        ChartValues<ObservablePoint> Temperatures { get; set; }
        ObservablePoint Temperature { get; set; }
        ChartValues<ObservablePoint> Humidities { get; set; }
        ObservablePoint Humidity { get; set; }
        Visibility ShowTemperature { get; set; }
        Visibility ShowHumidity { get; set; }
        /// <summary>
        /// X轴格式化
        /// </summary>
        Func<double, string> XFormatter { get; set; }
        /// <summary>
        /// Y轴格式化
        /// </summary>
        Func<double, string> YFormatter { get; set; }

        /// <summary>
        /// 向曲线集合中增加一个坐标
        /// </summary>
        /// <param name="point"></param>
        /// <param name="mode"></param>
        void Add(ObservablePoint point, MouseWorkMode mode);
    }
}
